{{define "get/API.html"}}
<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <title>API</title>
  </head>

  <!--<style type="text/css">
    *{
      -webkit-user-select: auto;
    }
  </style> -->

  <body>
    <a href={{.uploadfile}}>Win上传网址</a> ：  <span id="content1">{{.uploadfile}}</span>
    <p></p>
    Linux上传方式： <span id="content"> curl -X POST --url http://{{.hostname}}/upload -H 'content-type: multipart/form-data' -F 'f1=@/文件路径'  </span>
    <button id="copyBT">复制</button>
    <p></p>
    <a href={{.getclientip}}>获取客户端IP</a> : <span id="content2">{{.getclientip}}</span>
    <p></p>
    <a href={{.getserverip}}>获取服务器IP</a> : <span id="content3">{{.getserverip}}</span>
  </body>

    <script>
      function copyArticle(event) {
        const range = document.createRange();
        range.selectNode(document.getElementById('content'));

        const selection = window.getSelection();
        if(selection.rangeCount > 0) selection.removeAllRanges();
        selection.addRange(range);
        document.execCommand('copy');
        alert("复制成功！");
      }

      document.getElementById('copyBT').addEventListener('click', copyArticle, false);
    </script>
</html>

{{end}}